<%@page pageEncoding="UTF-8"%>

<div class="btn-group" style="padding-top: 10px;" >
    <c:if test="${iPage.current - 1 > 0}">
        <button class="btn btn-white" onclick="goTo(1)" >首页</button>
    </c:if>
    <c:if test="${iPage.current == 1}">
        <button class="btn btn-white" >首页</button>
    </c:if>
    <c:if test="${iPage.current -1 > 0}">
        <button class="btn btn-white" onclick="goTo(${iPage.current - 1})">上一页</button>
    </c:if>
    <c:if test="${iPage.current == 1}">
        <button class="btn btn-white"  >上一页</button>
    </c:if>
    <c:if test="${iPage.current - 2 > 0 }">
        <button class="btn btn-white " onclick="goTo(${iPage.current - 2})">${iPage.current - 2}</button>
    </c:if>
    <c:if test="${iPage.current - 1 > 0 }">
        <button class="btn btn-white " onclick="goTo(${iPage.current - 1})">${iPage.current - 1}</button>
    </c:if>

    <button class="btn btn-white active" >${iPage.current}</button>

    <c:if test="${iPage.current + 1 <= iPage.pages}">
        <button class="btn btn-white "  onclick="goTo(${iPage.current + 1})">${iPage.current + 1}</button>
    </c:if>
    <c:if test="${iPage.current + 2 <= iPage.pages}">
        <button class="btn btn-white " onclick="goTo(${iPage.current + 2})">${iPage.current + 2}</button>
    </c:if>
    <c:if test="${iPage.current  < iPage.pages}">
        <button class="btn btn-white" onclick="goTo(${iPage.current + 1})">下一页</button>
    </c:if>
    <c:if test="${iPage.current >= iPage.pages}">
        <button class="btn btn-white" >下一页</button>
    </c:if>
    <c:if test="${iPage.current  < iPage.pages}">
        <button class="btn btn-white" onclick="goTo(${iPage.pages})">尾页</button>
    </c:if>
    <c:if test="${iPage.current >= iPage.pages}">
        <button class="btn btn-white" >尾页</button>
    </c:if>
</div>
